package com.sxbbc.common.core.enums;

import java.util.ArrayList;
import java.util.List;

import com.sxbbc.common.basics.utils.calculation.CalcuUtils;

/**
 * @author xiaoky
 * @description 订单状态枚举
 * @date 2019-05-09
 */
public enum OrderStatusEnums {
	REFUND(0,"全部退款"),
	CANCEL(1,"已取消"),
	COMFIRE(5,"待支付"),
	NEED_SEND(10,"待发货"),
	HAS_SEND(15,"待收货"),
	RECEIVED(20,"待评价"),
	OVER(25,"已完成");
	
	private Integer id;
	 
    private String name;

    public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
 
	private OrderStatusEnums(Integer id,String name){
		this.id=id;
		this.name=name;
	}
	
	public static List<OrderStatusEnums> queryList(){
		List<OrderStatusEnums> list=new ArrayList<OrderStatusEnums>();
		for(OrderStatusEnums o:OrderStatusEnums.values()){
			list.add(o);
		}
		return list;
	}
	
	public static String getName(Integer id){
		String str="";
		for(OrderStatusEnums o:OrderStatusEnums.values()){
			if(CalcuUtils.getInstance().isEquals(id, o.getId())){
				str= o.getName();
				break;
			}
		}
		return str;
	}
}
